package com.soo.hoo.admin.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.soo.hoo.core.model.BaseEntry;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 礼簿
 * </p>
 *
 * @author 杨燚
 * @since 2024-04-20
 */
@Getter
@Setter
@TableName("t_sys_book")
@Schema(name = "SysBook", description = "礼簿")
public class SysBook extends BaseEntry {

    @Schema(description = "唯一标识")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "用户id")
    @NotNull(message = "用户id不能为空，请检查表单")
    private Long userId;

    @Schema(description = "礼簿名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "请填写礼簿名称")
    private String bookName;

    @Schema(description = "礼簿所属的家庭的唯一编码，外人通过该编码可查看礼簿清单明细")
    @NotBlank(message = "监听id不能为空，请检查表单")
    private String familyId;

    @Schema(description = "收礼日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "请选择收礼日期")
    private LocalDate receiveDate;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "图片封面id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long coverId;

    @Schema(description = "是否删除，为空时未删除")
    @TableLogic
    private LocalDateTime deleted;
}
